// 创建路由对象
export const routes = [
  // 首页
  {
    path: '/',
    component: () => import('@/views/home/index.vue'),
    meta: {
      isShow: true,
      title: '首页',
      icon: 'wap-home-o'
    }
  },
  {
    path: '/home',
    redirect: '/',
    meta: {
      isShow: false
    },
    children: [
      // 商品详情
      {
        path: 'detail',
        component: () => import('@/views/home/detail/index.vue')
      }
    ]
  },
  //搜索页
  {
    path: '/search',
    component: () => import('@/views/home/search/search.vue'),
    meta: {
      isShow: false
    }
  },

  //   分类
  {
    path: '/cate',
    component: () => import('@/views/cate/index.vue'),
    meta: {
      isShow: true,
      title: '分类',
      icon: 'orders-o'
    }
  },
  // 分类列表
  {
    path: '/list',
    component: () => import('@/components/GoodsList/index.vue'),
    meta: {
      isShow: false
    }
  },

  //   值得购买
  {
    path: '/widthbuy',
    component: () => import('@/views/widthbuy/index.vue'),
    meta: {
      isShow: true,
      title: '值得买',
      icon: 'shop-collect-o'
    }
  },
  {
    path:'/toSearch',
    component:()=> import('@/components/Search/index.vue'),
    meta:{
      isShow:false,
      title:'',
    }
  },

  //   购物车
  {
    path: '/cart',
    component: () => import('@/views/cart/index.vue'),
    meta: {
      isShow: true,
      title: '购物车',
      icon: 'cart-o'
    }
  },
  // 支付
  {
    path: '/pay',
    component: () => import('@/views/pay/index.vue'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/paying',
    component: () => import('@/views/paying/index.vue'),
    meta: {
      isShow: false
    }
  },

  {
    path: '/orderlist',
    component: () => import('@/views/paying/OrderLists/index.vue'),
    meta: {
      isShow: false
    }
  },
  //   个人中心
  {
    path: '/my',
    component: () => import('@/views/my/index.vue'),
    meta: {
      isShow: true,
      title: '个人',
      icon: 'manager-o'
    }
  },

  //   登录页面
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      isShow: false
    }
  },

  //   404
  {
    path: '/404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      isShow: false
    }
  },
  // 注册
  {
    path: '/register',
    component: () => import('@/views/register/index.vue'),
    meta: {
      isShow: false
    }
  },
  // 地址页面
  {
    path: '/address',
    component: () => import('@/views/address/index.vue'),
    meta: {
      isShow: false
    }
  },

  // 通配符
  {
    path: '/:pathMatch(.*)*',
    name: 'Any',
    // redirect: '/404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      isShow: false
    }
  }
]
